package han.chensing.latos.common.level.content.timeLine.events;

import han.chensing.latos.common.level.content.timeLine.frame.BaseFrame;

import java.io.Serial;
import java.io.Serializable;

public abstract class TimeLineEvent<F extends BaseFrame<?>> implements Serializable {

    @Serial
    private static final long serialVersionUID = -9105666195783895832L;

    protected String name="Event";
    protected float fromTime;
    protected float toTime;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getToTime() {
        return toTime;
    }

    public void setToTime(float toTime) {
        this.toTime = toTime;
    }

    public float getFromTime() {
        return fromTime;
    }

    public void setFromTime(float fromTime) {
        this.fromTime = fromTime;
    }

    /**
     * Get the relative frame(Delta) or absolute frame(according to the field)
     * @param relativeTime time that relative to start of event
     * @return the frame
     */
    public abstract F getFrame(float relativeTime);
}
